package com.fafi.rxjava2.operatorbackpress;

import com.fafi.rxjava2.backpress.Receiver;

public class TelephonerLift<R, T> extends TelephonerWithUpstream<T, R> {


    private final TelephonerOperator<R, T> operator;

    public TelephonerLift(Telephoner<T> source, TelephonerOperator<R, T> operator) {
        super(source);
        this.operator = operator;
    }

    @Override
    protected void callActual(Receiver<R> receiver) {
        Receiver<T> tReceiver = operator.call(receiver);
        source.call(tReceiver);
    }
}
